public class Solution1785 {
    public int minElements(int[] nums, int limit, int goal) {
        long a=0;
        for (int num : nums) {
            a+=num;
        }
        return div(Math.abs(a-goal),limit);
    }

    private int div(long a, int b) {
        return (int)(a%b==0?a/b:a/b+1);
    }

    public static void main(String[] args) {
        System.out.println(new Solution1785().minElements(new int[]{1,-1,1},3,-4));
    }
}
